{{#if instances.length}}
    <div class="table-container">
        <table class="table">
            <thead>
                <tr>
                    <th>{{t 'common.form.name'}}</th>
                    <th>{{t 'common.form.type'}}</th>
                    <th class="fr-col-btn-2"></th>
                </tr>
            </thead>
            <tbody>
                {{#each instances}}
                    <tr data-subschema-id="{{_id}}" data-subschema-type="{{_type._id}}">
                        <td class="wordwrap">
                            <a href="{{routeTo 'globalServiceSubSchemaEdit' ../serviceType _type._id _id}}"
                                title="{{t 'common.form.edit'}}">{{_id}}</a>
                        </td>
                        <td class="wordwrap">{{_type.name}}</td>
                        <td class="fr-col-btn-2">
                            <div class="btn-group">
                                <a class="btn btn-link" href="{{routeTo 'globalServiceSubSchemaEdit' ../serviceType _type._id _id}}"
                                    title="{{t 'common.form.edit'}}">
                                    <i class="fa fa-pencil"></i>
                                </a>
                                {{#if ../showDeleteButton}}
                                <button type="button" data-subschema-delete class="btn btn-link" title="{{t 'common.form.delete'}}">
                                    <i class="fa fa-close"></i>
                                </button>
                                {{/if}}
                            </div>
                        </td>
                    </tr>
                {{/each}}
            </tbody>
        </table>
    </div>

    {{#if creatables.length}}
        {{#if creatables.[1]}}
            <div class="btn-group pull-right">
                <button type="button" class="btn btn-default dropdown-toggle"
                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {{t "console.services.subSchema.add"}} <span class="caret"></span>
                </button>

                <ul class="dropdown-menu">
                    {{#each creatables}}
                    <li><a href="{{routeTo 'globalServiceSubSchemaNew' ../serviceType _id}}">{{name}}</a></li>
                    {{/each}}
                </ul>
            </div>
        {{else}}
            <a class="btn btn-default pull-right" href="{{routeTo 'globalServiceSubSchemaNew' serviceType creatables.[0]._id}}"
                title="{{t 'common.form.edit'}}">
                <i class="fa fa-plus"></i> {{t "console.services.subSchema.add"}}
            </a>
        {{/if}}
    {{/if}}
{{else}}
    <div class="call-to-action-block">
        <h3>{{t "console.services.subSchema.callToAction"}}</h3>

        {{#if creatables.length}}
            {{#if creatables.[1]}}
                <div class="btn-group">
                    <button type="button" class="btn btn-primary dropdown-toggle"
                        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        {{t "console.services.subSchema.add"}} <span class="caret"></span>
                    </button>

                    <ul class="dropdown-menu">
                        {{#each creatables}}
                        <li><a href="{{routeTo 'globalServiceSubSchemaNew' ../serviceType _id}}">{{name}}</a></li>
                        {{/each}}
                    </ul>
                </div>
            {{else}}
                <a class="btn btn-primary" href="{{routeTo 'globalServiceSubSchemaNew' serviceType creatables.[0]._id}}"
                    title="{{t 'common.form.edit'}}">
                    <i class="fa fa-plus"></i> {{t "console.services.subSchema.add"}}
                </a>
            {{/if}}
        {{/if}}
    </div>
{{/if}}
